﻿namespace leastSquareMethod;
internal class Program
{
    static void Main(string[] args)
    {//设置对象数组，每个对象是一个年份
        Points[] objs = new Points[20];
        objs[0] = new Points(2001, 1339395718862);
        objs[1] = new Points(2002, 1470550015077);
        objs[2] = new Points(2003, 1660287965663);
        objs[3] = new Points(2004, 1955347004965);
        objs[4] = new Points(2005, 2285965892364);
        objs[5] = new Points(2006, 2752131773358);
        objs[6] = new Points(2007, 3550342737009);
        objs[7] = new Points(2008, 4594307032667);
        objs[8] = new Points(2009, 5101703073088);
        objs[9] = new Points(2010, 6087163874510);
        objs[10] = new Points(2011, 7551500124197);
        objs[11] = new Points(2012, 8532229986993);
        objs[12] = new Points(2013, 9570406235659);
        objs[13] = new Points(2014, 10475682920597);
        objs[14] = new Points(2015, 11061553079871);
        objs[15] = new Points(2016, 11233276536744);
        objs[16] = new Points(2017, 12310409370894);
        objs[17] = new Points(2018, 13894817549380);
        objs[18] = new Points(2019, 14279937500608);
        objs[19] = new Points(2020, 14687673892882);
        Console.WriteLine("请输入年份");
       int year=int.Parse(Console.ReadLine());
        Console.WriteLine($"{year}年GDP预测值为{ LeastSquareMethod.leastsquaremethod(objs, year).ToString()}");
    }
}